<?php
/**
 * This file defines the exception class {@see \BF\ArgumentFormatException}.
 *
 * @author     Kado <ulfikado@gmail.com>
 * @category   Beluga PHP5.3+ Framework
 * @package    BF\Core
 * @since      2015-01-17 14:29
 * @subpackage Exceptions
 * @version    0.1
 */

namespace BF
{

   /**
    * This exception should be used if a method/function call attribute/parameter uses a invalid format.
    *
    * The class extends from {@see \BF\ArgumentException}
    *
    * @since  v0.1
    */
   class ArgumentFormatException extends \BF\ArgumentException
   {

      # <editor-fold defaultstate="collapsed" desc=" - - >   P U B L I C   C O N S T R U C T O R   - - - - - - - - - - - - - - - - - -">

      /**
       * Inits a new instance.
       *
       * @param string     $arg      The argument/parameter name
       * @param mixed      $value    The argument/parameter value
       * @param string     $message  The error message (default=null)
       * @param int        $code     The error code (default=\E_USER_ERROR)
       * @param \Exception $previous A optional previous exception
       */
      public function __construct( $arg, $value, $message = null, $code = \E_USER_ERROR, \Exception $previous = null )
      {
         parent::__construct(
            $arg,
            $value,
            'Argument is illegal or has a unknown format.' . self::appendMessage( $message ),
            $code,
            $previous
         );
      }

      # </editor-fold>

   }

}

